package com.guanyong.webapi.controllers.api;

import com.guanyong.model.AdvertisementModel;
import com.guanyong.services.AdService;
import com.guanyong.utils.Comm.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Administrator on 2017/10/19 0019.
 */
@RestController
@RequestMapping("/api/ad/")
public class AdApi {

    @Autowired
    AdService adService;
    //获取某部电影的评论  以及回复
    @RequestMapping(value = "getadrom", method = RequestMethod.GET)
    ResultObject<AdvertisementModel> getAdRom(HttpServletRequest request,
                                                         @RequestParam Integer type) {
        ResultObject<AdvertisementModel> result = new ResultObject<AdvertisementModel>();
        AdvertisementModel advertisementModel=adService.GetAdRom(type);
        result.setResult(advertisementModel);
        return result;
    }
}
